package demo.yml;

import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.constructor.Constructor;

/**
 * 自定义构造器
 */
public class CustomConstructor extends Constructor {

    public CustomConstructor(LoaderOptions options) {
        super(options);
        this.addTypeDescription(new TypeDescription(CustomType1.class, "!TYPE1"));
        this.addTypeDescription(new TypeDescription(CustomType2.class, "!TYPE2"));
    }

    public CustomConstructor() {
        this(new LoaderOptions());
    }
}
